const Controller = require('./../core/baseController');

class IndexControler extends Controller {
  async index() {
    const { ctx, service, config, logger, user } = this;
    const { helper } = ctx;
    let res = await service.index.index('你好');
    res.time = helper.mt(new Date()).format('YYYY-MM-DD HH:mm:ss');
    // res.config = config;
    logger.debug('debug...');
    logger.info('info...')
    logger.warn('warn...')
    logger.error('error...')
    console.log('------------------------');
    console.log(config.env);
    console.log('------------------------');
    console.log(process.env.NODE_ENV);
    console.log('------------------------');
    console.log(user);
    console.log('------------------------');
    this.success(res);
  }

  async detail(){
    const { ctx } = this;
    const { params } = ctx;
    ctx.body = `这是详情${params.id}`;
  }
}

module.exports = IndexControler;